new_version=$V_SERVER

echo "清除无效版本..."
docker rmi -f $(docker images | grep "none" | awk '{print $3}')

echo "清除旧版本..."
docker rmi -f $(docker images | grep "shanghai" | grep -v "fu-client-manager" | grep -v "fu-client-portal" | grep -v "xxl-job" | awk '{print $3}')
docker rmi -f $(docker images | grep "fu/" | grep -v "fu-client-manager" | grep -v "fu-client-portal" | grep -v "xxl-job" | awk '{print $3}')

MODULES="../MODULES.fu"

cat $MODULES | while read module
do
  ./build.sh $module $new_version
done

cd ./k8s
./start.sh
